package com.hotmocha.jclient.model;

import com.hotmocha.jclient.comm.R;
/*
INT     4       groupid
STRING  40      groupname
INT     4       clientid
STRING  40      clientname
INT     4       contentlen
STRING  4096    content
*/
public class Message implements BaseMessage {
	public int groupid;
	public String groupname;
	public int clientid;
	public String clientname;
	public int contentlen;
	public String content;
	
	public Message(int groupid, String groupname, int clientid, String clientname,
			String content) 
	{
		this.groupid = groupid;
		this.groupname = groupname;
		this.clientid = clientid;
		this.clientname = clientname;
		this.content = content;
		this.contentlen = this.content.length();
	}
	
	public String toString() {
		return "groupid: " + this.groupid +
				" groupname: " + this.groupname + 
				" clientid: " + this.clientid + 
				" clientname: " + this.clientname + 
				" contentlen: " + this.contentlen + 
				" content: " + this.content;
	}

	@Override
	public int getMessageType() {
		return R.MSG_TYPE_COMM_MSG;
	}
}